package com.jamu.mbok;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class CreditScreen extends Activity{
	
	Button back;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.credit_layout);
        this.castItem();
        this.addAction();
	}
	
	
	public void castItem(){
		back = (Button)findViewById(R.id.creditback);
	}
	
	public void addAction(){
		back.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				if(event.getAction()==MotionEvent.ACTION_DOWN){
					// Ganti gambar
				}else if(event.getAction()==MotionEvent.ACTION_UP){
					// balikin gambar
					nextAct();
				}
				return false;
			}
		});
	}
	
	public void nextAct(){
		this.startActivity(new Intent("android.intent.action.HOMESCREEN"));
		overridePendingTransition(R.anim.fade, R.anim.hold);
		this.finish();
	}
	
}
